*Study 2: Replication Do File
*YouGov Study (emotion-induction design)
*By: Vanessa Cruz Nichols

************************************************************************************************** 
use "Study2_AJPS.dta"

*Table 3: "Study 2, Emotion-Induction Treatment Effects on Informal and Formal Participation"
	reg participate7_std i.treatments if outlier==0 &  nonlatino==0 [pw=weight] 
	*outreg2 using "table3_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-7") label replace excel seeout 			
	
	reg participate3_std i.treatments if outlier==0 &  nonlatino==0 [pw=weight] 
	*outreg2 using "table3_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-3") label append excel seeout 				
	
	logit postcard2c  i.treatments if outlier==0 &  nonlatino==0 [pw=weight] 
	*outreg2 using "table3_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard") label append excel seeout 			
	
	logit postcard2c  i.treatments if outlier==0 &  nonlatino==0  [pw=weight], or
	*outreg2 using "table3_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard, OR") eform label append excel seeout 
	
*Table 4: "Study 2, Emotion-Induction Treatment Effects on Informal and Formal Political Participation, by Partisan Group"

*Among Dems
	reg participate7_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-7") label replace excel seeout 		
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight] 
	*outreg2 using "table4_full_immig_pid", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-3") label append excel seeout 				
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1  [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard") label append excel seeout 			
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight], or 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard, OR") eform label append excel seeout 	

*Among Reps
	reg participate7_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==0 [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-7") label append excel seeout 		
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==0 [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-3") label append excel seeout 				
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==0  [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard") label append excel seeout 			
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==0 [pw=weight], or 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard, OR") eform label append excel seeout 	
	
	
*Among Indeps
	reg participate7_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==.5 [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-7") label append excel seeout 		
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==.5 [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-3") label append excel seeout 				
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==.5  [pw=weight] 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard") label append excel seeout 			
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==.5 [pw=weight], or 
	*outreg2 using "table4_full_immig_pid.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard, OR") eform label append excel seeout 	

	
*Figure 5: "Study 2, Predictive Margins of Informal Political Participation (Democrats)"
	*reg participate7_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight] 
	*margins i.treatments, post
	*	coefplot, xtitle(Treatments) ytitle(Pr Informal participation) vertical rescale(100) ytitle(Percent) recast(bar) barwidth(0.20) fcolor(gs10) scheme(s1color) ciopts(recast(rcap)) citop
	*gr save ParticD7_dems.gph, replace
	
	*Used 3-item participation scale in Figure 5 for paper.
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight] 
	margins i.treatments, post
		coefplot, xtitle(Treatments) ytitle(Pr Informal participation) vertical rescale(100) ytitle(Percent) recast(bar) barwidth(0.20) fcolor(gs10) scheme(s1color) ciopts(recast(rcap)) citop
	gr save ParticD3_dems.gph, replace
	
*Figure 6: "Study 2, Predictive Margins of Formal Political Participation (Republicans)"
	*Used 3-item participation scale in Figure 6 for paper.
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==0 [pw=weight] 
	margins i.treatments, post
		coefplot, xtitle(Treatments) ytitle(Pr Informal participation) vertical rescale(100) ytitle(Percent) recast(bar) barwidth(0.20) fcolor(gs10) scheme(s1color) ciopts(recast(rcap)) citop
	gr save ParticD3_reps.gph, replace

*Figure 7: "Study 2, Predictive Margins of Formal Political Participation (Republicans)" 
	logit postcard2c i.treatments immigrant_tone if outlier==0 &  nonlatino==0 & partyid3==1 [pw=weight] 
	margins i.treatments, post
		coefplot, xtitle(Treatments) ytitle(Pr formal participation) vertical rescale(100) ytitle(Percent) recast(bar) barwidth(0.20) fcolor(gs10) scheme(s1color) ciopts(recast(rcap)) citop
	gr save postcardD_reps.gph, replace
	
	
*Table Appendix (no partisan group subsets): "Study 2, Emotion-Induction Treatment Effects on Informal and Formal Political Participation"
	reg participate7_dum i.treatments immigrant_tone if outlier==0 &  nonlatino==0 [pw=weight] 
	*outreg2 using "table_app_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-7") eform label replace excel seeout 		
	reg participate3_std i.treatments immigrant_tone if outlier==0 &  nonlatino==0  [pw=weight] 
	*outreg2 using "table_app_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Participate-3") eform label append excel seeout 				
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0  [pw=weight] 
	*outreg2 using "table_app_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard") label append excel seeout 			
	logit postcard2c  i.treatments immigrant_tone if outlier==0 &  nonlatino==0 [pw=weight], or 
	*outreg2 using "table_app_full_immig.doc", dec(3) paren(se) title("Effect of Tx")  ctitle("Sent Postcard, OR") eform label append excel seeout 
